package com.security.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.security.domain.SysUserRoleEntity;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author Xiongx
 * @version 1.0
 * @date 2021/6/11 14:44
 * @since JDK 1.8
 */
public interface SysUserRoleMapper extends BaseMapper<SysUserRoleEntity> {

    @Select("<script> SELECT * from sys_user_role where user_id=#{uid} and  role_id in " +
            "             <foreach collection=\"rids\" item=\"item\"  close=\")\" open=\"(\" separator=\",\">" +
            "                          #{item}" +
            "              </foreach>" +
            "</script>")
    List<SysUserRoleEntity> selectSysUserRoleEntityList(@Param("uid")String uid,@Param("rids") String[] rids);
}
